package com.ruoyi.activiti.listener.task;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.activiti.engine.delegate.TaskListener;

import java.util.Map;

/**
 * @description: 任务监听器
 * 任务结束，发送短信等
 * @author: stone
 * @date: Created by 2023/2/12 15:21
 * @version: 1.0.0
 * @pakeage: com.ruoyi.activiti.listener
 */
@Slf4j
public class LeaveTaskListener implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        String assignee = delegateTask.getAssignee();
        log.info("执行人 ===> {}", assignee);
        //1.发送短信 todo

        log.info("发送短信 ===>");
        //2.动态查询主管领导审批

        Map<String, Object> variables = delegateTask.getVariables();

        //delegateTask.setVariable("leader", "zhangsan");

        log.info("审批人在参数中 ===> {}",variables);


    }
}
